package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_BranchCompanyStaffRoyaltyRecord 分公司员工提成记录
 *
 */
public class TestData_TB_BranchCompanyStaffRoyaltyRecord
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaffRoyaltyRecord saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_ProductOrder productOrder
	,bairui.international.model.domain.jpa.TB_ProductOrderItem productOrderItem
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaffRoyaltyRecord");
		return (TB_BranchCompanyStaffRoyaltyRecord)repository.save(newMust(
				productOrder
				,productOrderItem
				,branchCompanyStaff
			));
	}
	
	public static TB_BranchCompanyStaffRoyaltyRecord newMust(
		bairui.international.model.domain.jpa.TB_ProductOrder productOrder
	,bairui.international.model.domain.jpa.TB_ProductOrderItem productOrderItem
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		return new TB_BranchCompanyStaffRoyaltyRecord(new TB_BranchCompanyStaffRoyaltyRecord.MustProperties() {
			/** 金额 */
			@Override public Double getMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 产品订单 */
			@Override public bairui.international.model.domain.jpa.TB_ProductOrder getProductOrder(){
				return productOrder;
			}
			/** 产品订单项 */
			@Override public bairui.international.model.domain.jpa.TB_ProductOrderItem getProductOrderItem(){
				return productOrderItem;
			}
			/** 分公司员工 */
			@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getBranchCompanyStaff(){
				return branchCompanyStaff;
			}
			/** 百分比 */
			@Override public Double getRate(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompanyStaffRoyaltyRecord saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_ProductOrder productOrder
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaffMoneyRecord branchCompanyStaffMoneyRecord
	,bairui.international.model.domain.jpa.TB_ProductOrderItem productOrderItem
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompanyStaffRoyaltyRecord");
		return (TB_BranchCompanyStaffRoyaltyRecord)repository.save(newAll(
				productOrder
				,branchCompanyStaffMoneyRecord
				,productOrderItem
				,branchCompanyStaff
			));
	}
	
	public static TB_BranchCompanyStaffRoyaltyRecord newAll(
		bairui.international.model.domain.jpa.TB_ProductOrder productOrder
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaffMoneyRecord branchCompanyStaffMoneyRecord
	,bairui.international.model.domain.jpa.TB_ProductOrderItem productOrderItem
	,bairui.international.model.domain.jpa.TB_BranchCompanyStaff branchCompanyStaff
	){
		return new TB_BranchCompanyStaffRoyaltyRecord(
			new TB_BranchCompanyStaffRoyaltyRecord.MustProperties() {
				/** 金额 */
				@Override public Double getMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 产品订单 */
				@Override public bairui.international.model.domain.jpa.TB_ProductOrder getProductOrder(){
					return productOrder;
				}
				/** 产品订单项 */
				@Override public bairui.international.model.domain.jpa.TB_ProductOrderItem getProductOrderItem(){
					return productOrderItem;
				}
				/** 分公司员工 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getBranchCompanyStaff(){
					return branchCompanyStaff;
				}
				/** 百分比 */
				@Override public Double getRate(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
			},
			new TB_BranchCompanyStaffRoyaltyRecord.OptionalSingleProperties() {
				/** 分公司员工金额记录 */
				@Override public bairui.international.model.domain.jpa.TB_BranchCompanyStaffMoneyRecord getBranchCompanyStaffMoneyRecord(){
					return branchCompanyStaffMoneyRecord;
				}
			}
		);
	}
	

}
